package com.farm.strategy;

// 策略模式使用示例
public class StrategyPatternDemo {
    public static void main(String[] args) {
        PathPlanner planner = new PathPlanner();

        String machineName = "Machine A";
        // 正常情况
        planner.setStrategy(new NormalPathStrategy());
        planner.executePathPlanning(machineName);

        // 检测到障碍物
        planner.setStrategy(new AvoidObstacleStrategy());
        planner.executePathPlanning(machineName);

        // 检测到湿地
        planner.setStrategy(new WetSoilStrategy());
        planner.executePathPlanning(machineName);
    }
}